package com.pkk.penguin.frame.know.java.driven.beanleftcycle.config;

import com.pkk.penguin.frame.know.java.driven.beanleftcycle.bean.BeanLeftCycleBean;
import com.pkk.penguin.frame.know.java.driven.beanleftcycle.bean.BeanLeftCycleBean1;
import com.pkk.penguin.frame.know.java.driven.beanleftcycle.bean.BeanLeftCycleBean2;
import com.pkk.penguin.frame.know.java.driven.beanleftcycle.bean.BeanLeftCycleBean3;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

/**
 * @description:
 * @author: peikunkun
 * @create: 2020-08-04 11:19
 **/
@Configuration
public class BeanLeftCycleConfig {


  //@Scope(value = "singleton")
  @Scope(value = "prototype")
  @Bean(initMethod = "init", destroyMethod = "destory")
  public BeanLeftCycleBean beanLeftCycleBean() {
    System.out.println("BeanLeftCycleBean 【@Bean(initMethod = \"init\", destroyMethod = \"destory\")】  执行了");
    return new BeanLeftCycleBean();
  }


  @Bean
  public BeanLeftCycleBean1 beanLeftCycleBean1() {
    return new BeanLeftCycleBean1();
  }


  @Bean
  public BeanLeftCycleBean2 beanLeftCycleBean2() {
    return new BeanLeftCycleBean2();
  }


  @Bean
  public BeanLeftCycleBean3 beanLeftCycleBean3() {
    return new BeanLeftCycleBean3();
  }


}
